package com.example.demosecuritymvc.mapper;

import com.example.demosecuritymvc.entity.Role;
import com.example.demosecuritymvc.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select r.* from role r,user_role ur where r.`id`=#{id}")
    List<Role> getRolesByUid(Integer id);

    @Select("select * from user where username=#{username}")
    User loadUserByUsername(String username);
}
